@extends('admin.index.layout')

@section('title', $title)

@section('content')
    
        <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                商品管理
                <small>下架商品列表</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="#">商品管理</a></li>
                <li class="active">列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">


                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">查看下架商品列表</h3>
                        </div><!-- /.box-header -->
                        <div class="box-body">
                            <form action="{{ url('/admin/shop/out') }}">

                                <div class="row">
                                    <div class="col-md-4">
                                        <div class="input-group margin">
                                            <input type="text" class="form-control" value="{{ $request['keywords'] or '' }}" name="keywords">
                                            <span class="input-group-btn">
                                              <button class="btn btn-info btn-flat" type="submit">搜索</button>
                                            </span>
                                        </div>
                                    </div>

                                    <div class="col-md-2  col-md-offset-6">
                                        <div class="form-group">
                                        
                                            <label>Select</label>
                                            <select name="num" class="form-control">
                                                <option
                                                @if(!empty($request['num']) 
                                                && $request['num'] == 5)
                                                    selected = "selected"
                                                @endif
                                                >5</option>
                                                <option
                                                @if(!empty($request['num']) 
                                                && $request['num'] == 10)
                                                    selected = "selected"
                                                @endif
                                                >10</option>
                                                <option
                                                @if(!empty($request['num']) 
                                                && $request['num'] == 25)
                                                    selected = "selected"
                                                @endif
                                                >25</option>
                                                <option
                                                @if(!empty($request['num']) 
                                                && $request['num'] == 50)
                                                    selected = "selected"
                                                @endif
                                                >50</option>
                                                <option
                                                @if(!empty($request['num']) 
                                                && $request['num'] == 100)
                                                    selected = "selected"
                                                @endif
                                                >100</option>
                                            </select>

                                        </div>
                                    </div>
                                </div>
                            </form>
                                
                            <table id="example1" class="table table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>商品类别</th>
                                    <th>商品名</th>
                                    <th>商品价格</th>
                                    <th>商品产地</th>
                                    <th>商品库存</th>
                                    <th>上架商品</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($data as $u)
                                <tr>
                                    <td class="ids">{{$u -> gid }}</td>
                                    <td class="ppname">{{$u -> ppname }}</td>
                                    <td class="name">{{$u -> gname }}</td>
                                    <td class="gprice">{{$u -> gprice }}</td>
                                    <td class="home">{{$u -> home }}</td>
                                    <td class="count">{{$u -> total - $u -> count}}</td>
                                    <td class="state"> &nbsp; &nbsp; <a href="{{url('/admin/shop/status')}}/{{$u -> gid}}"><i class="fa fa-fw fa-cloud-upload"></i></a></td>
                                    <td><a href="{{url('/admin/shop/edit')}}/{{$u -> gid}}"><i class="fa fa-fw fa-pencil"></i></a> &nbsp; <a href="{{url('/admin/shop/delete')}}/{{$u -> gid}}"><i class="fa fa-fw fa-remove"></i></a></td>
                                </tr>
                                @endforeach
                                </tbody>
                            </table>
                        {!! $data ->appends($request) -> render() !!}  
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->

    
    


@endsection